package 补充.多线程;
class MySingletonl{
    private static MySingletonl instance =new MySingletonl();
    MySingletonl(){}
    public static MySingletonl getInstance(){
        return instance;
    }
    public  void show(){
        System.out.println("饿汉式单列模式");
    }
}
public class 饿汉式单列 {
    public static void main(String[] args) {
        MySingletonl obj=new MySingletonl();
        MySingletonl obj1 = MySingletonl.getInstance();
        obj1.show();
    }
}